package com.miku.utils;

/**
 * 服务器运行位置管理工具
 * @author 杜金伟 [2016年4月8日 下午6:18:15]
 */
public class ServerPositionUtils {
	public static final int inServer = 1;		//运行在服务器上
	public static final int inLocal = 2;		//运行在本地
	
	private static int position = inLocal;		//默认在本地
	public static boolean inServer(){
		return position == inServer;
	}
	
	public static boolean inLocal(){
		return position == inLocal;
	}
	
	public static void setupPositionForOSName(){
		switch(OSUtils.osType()){
		case Linux:
			position = inServer;
			break;
			
		default:
			position = inLocal;
			break;
		}
	}
	
	public static int getPosition(){
		return position;
	}
}
